<h1 class="heading">
    <?php 
	global $post_id;
    //$row = $wpdb->get_row("SELECT name from ".$wpdb->prefix."terms WHERE term_id = " . $cs_blog_cat_db );
    //echo $row->name; 
	echo $cs_blog_title_db;
    ?>
</h1>
	<?php
		if ( empty($_GET['page_id_all']) ) $_GET['page_id_all'] = 1;
		$count_post = 0;
		query_posts( array( 'posts_per_page' => '-1', 'post_type' => 'audios', 'category_name' => "mp" ) );
			while ( have_posts()) : the_post();
				$count_post++; 
                                var_dump($count_post);
			endwhile;
			if ( $cs_blog_pagination_db == "Single Page" ) $cs_blog_num_post_db = -1;

		query_posts( array( 'posts_per_page' => "$cs_blog_num_post_db", 'paged' => $_GET['page_id_all'], 'category_name' => "$cs_blog_cat_db" ) ); 
			$counter = 0;
			while ( have_posts()) : the_post();
				$image_id = get_post_thumbnail_id ( $post->ID );?>
					<div class="in-sec">
						<div class="blog-detail <?php if($image_id == ''){ echo 'no-image';}?>">
							<?php
							if($image_id <> ''){
								$image_url = cs_attachment_image_src($image_id, 580, 244);
								echo "<a href='".get_permalink()."' class='thumb'><img src='".$image_url."' /></a>";
							}
                                if ( $counter == 0 ) {
									$counter++;	?>
	                                <span class="featured">Latest</span>
                                <?php }?>
                            <div class="post-conts">
                                <div class="blog-opts">
                                    <div class="date">
                                        <h1><?php echo get_the_date();?></h1>
                                    </div>
                                    <div class="desc">
                                        <h4><a href="<?php echo get_permalink();?>"><?php echo get_the_title();?></a></h4>
                                        <p class="by">Posted by <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php echo get_the_author();?></a></p>
                                        <p class="coments"><a href="<?php echo get_permalink();?>#comments"><?php echo get_comments_number($post_id);?> Comments</a></p>
                                        <?php $tag_post = wp_get_post_tags( $post->ID );?>
                                        <p class="tags">
                                            <?php
                                            $counterr = 0;
                                            foreach(get_the_category() as $values){
                                                if($counterr == 0){ echo 'Category:  ';}
                                                $counterr++;
                                                echo '<a href="'.get_category_link($values->term_id).'">'.$values->name.'</a>  ';											
    
                                                }										
                                            ?> 
                                        </p>
                                        <div class="clear"></div>
                                    </div>
                                </div>
                                <div class="blog-desc">
                                    <p class="txt">
                                        <?php
											//echo get_the_excerpt()."<br /><br />";
											$get_the_excerpt = trim(preg_replace('/<a[^>]*>(.*)<\/a>/iU','', get_the_excerpt()));
											echo substr($get_the_excerpt, 0, "$cs_blog_excerpt_db");
											if ( strlen( $get_the_excerpt ) > "$cs_blog_excerpt_db" ) {
												echo '... <a href="'.get_permalink().'"> Read more</a>';
											}
                                        ?>
                                    </p>
                                </div>
                            </div>
                            <div class="clear"></div>
                        </div>
                      </div>             
						<?php
				endwhile;

			// pagination start
			if ( $cs_blog_pagination_db == "Show Pagination" and $cs_blog_num_post_db > 0 ) {
				echo "<div class='in-sec'><ul class='pagination'>";
					$qrystr = '';
					if ( isset($_GET['page_id']) ) $qrystr = "&page_id=".$_GET['page_id'];
				echo cs_pagination($count_post, $cs_blog_num_post_db,$qrystr);
				echo "</ul></div>";
			}
			// pagination end
        ?>

